package com.webridge.plm.test;


import java.net.URL;

import wt.content.ContentHelper;
public class JWhich {

    /**
     * 根据当前的classpath设置，
     * 显示出包含指定类的类文件所在
     * 位置的绝对路径
     *
     * @param className
     *            <类的名字>
     */
    public static void which(String className) {

        if (!className.startsWith("/")) {
            className = "/" + className;
        }
        className = className.replace('.', '/');
        className = className + ".class";

        URL classUrl =
                new JWhich().getClass().getResource(className);

        if (classUrl != null) {
            System.out.println(" Class '" + className +
                    "' found in　'" + classUrl.getFile() + "'");
        } else {
            System.out.println(" Class '" + className +
                    "' not found in　'" +
                    System.getProperty("java.class.path") + "'");
        }
    }

    public static void main(String args[]) {
        JWhich.which("com.ptc.windchill.enterprise.servlets.AttachmentsDownloadDirectionServlet");
    }
}
